package ${config.basePackage}.dao;

import javax.annotation.Resource;
import org.springframework.stereotype.Repository;
import ${config.basePackage}.mapper.${table.className}Mapper;
import ${config.basePackage}.model.entity.${table.className}Entity;
import java.util.List;
import java.util.Map;

/**
 * ${table.comment} Dao
 *
 * @author ${config.author}
 * @date ${.now?string("yyyy年MM月dd日 HH:mm:ss")}
 * @since JDK 17
 */
@Repository
public class ${table.className}Dao {

    @Resource
    private ${table.className}Mapper mapper;

    /**
     * 查询符合条件的所有${table.comment}记录
     *
     * @author ${config.author}
     * @param map 查询条件
     * @return 返回${table.comment}列表
     */
    public List<${table.className}Entity> listByConditions(Map<String, Object> map) {
        return mapper.listByConditions(map);
    }

    /**
     * 新增${table.comment}记录
     *
     * @author ${config.author}
     * @param ${table.className?uncap_first}Entity ${table.comment}实体类
     * @return 影响行数
     */
    public int save(${table.className}Entity ${table.className?uncap_first}Entity) {
	    return mapper.save(${table.className?uncap_first}Entity);
	}

    /**
     * 更新${table.comment}记录
     *
     * @author ${config.author}
     * @param ${table.className?uncap_first}Entity ${table.comment}实体类
     * @return 影响行数
     */
    public int update(${table.className}Entity ${table.className?uncap_first}Entity) {
	    return mapper.update(${table.className?uncap_first}Entity);
	}
}
